

<div class="layui-form" lay-filter="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">
  <div class="layui-form-item">
    <label class="layui-form-label">登录名</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="username" value="{{ d.params.username || '' }}" lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  <script type="text/html" template lay-url="/index/user/get_user_info">
  {{#  if(d.data.role === '超级管理员'){ }}
   <div class="layui-form-item">
      <label class="layui-form-label">密码</label>
      <div class="layui-input-inline">
        <input type="password" name="password" value="" lay-verify="password" placeholder="请输入密码" autocomplete="off" class="layui-input">
      </div>
    </div>
  {{#  } }}
  </script>

  <div class="layui-form-item">
    <label class="layui-form-label">手机</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="telphone" value="{{ d.params.telphone || '' }}" lay-verify="phone" placeholder="请输入号码" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">邮箱</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="email" value="{{ d.params.email || '' }}" lay-verify="email" placeholder="请输入邮箱" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">角色</label>
    <div class="layui-input-inline">
      <script type="text/html" template lay-url="/index/role/role_list" lay-done="layui.data.done(d);">
        <select name="role" {{ d.params.role === '超级管理员' ? 'disabled="disabled"' : '' }}>
          <option value="" >请选择</option>
          {{#  layui.each(d.data, function(index, item){ }}
          <option value="{{ item.id }}" {{ d.params.role === item.title ? 'selected' : '' }} {{ '超级管理员' === item.title ? 'disabled' : '' }}  >{{ item.title }}</option>
          {{#  }); }}
          {{#  if(d.data.length === 0){ }}
          无数据
          {{#  } }}
        </select>
      </script>
    </div>
  </div>

    <div class="layui-form-item">
    <label class="layui-form-label">菜单角色</label>
    <div class="layui-input-inline">
      <script type="text/html" template lay-url="/index/menu/menu_group" lay-done="layui.data.menu(d);">
        <select name="menu_role" {{ d.params.menu_role === '超级管理员' ? 'disabled="disabled"' : '' }}>
          <option value="" >请选择</option>
          {{#  layui.each(d.data, function(index, item){ }}
          <option value="{{ item.id }}" {{ d.params.menu_role === item.title ? 'selected' : '' }} {{ '超级管理员' === item.title ? 'disabled' : '' }}  >{{ item.title }}</option>
          {{#  }); }}
          {{#  if(d.data.length === 0){ }}
          无数据
          {{#  } }}
        </select>
      </script>
    </div>
  </div>


  <div class="layui-form-item">
    <label class="layui-form-label">审核状态</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="checkbox" lay-filter="switch" name="status" {{ d.params.status ? 'checked' : '' }} lay-skin="switch" lay-text="通过|关闭" value="1">
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label"></label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="hidden" name="id" value="{{ d.params.id || '' }}">
      </script>
      <input type="button" lay-submit lay-filter="LAY-user-back-submit" value="确认" class="layui-btn">
    </div>
  </div>




</div>




<script>
layui.use('auth', layui.factory('auth'));
layui.data.done = function(d){
  layui.use(['admin', 'form'], function(){
    var $ = layui.$
    ,form = layui.form;
    form.render(); //渲染该模板下的动态表单




  });
};
layui.data.menu = function(d){
  layui.use(['admin', 'form'], function(){
    var $ = layui.$
    ,form = layui.form;
    form.render(); //渲染该模板下的动态表单




  });
};
</script>